home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / bin / cisdownload < prev    next >
Text File  |  1994-03-10  |  2KB  |  76 lines

  1. : << README
  2. This file uses 8-character tabstops.
  3. cisdownload @(#)Download CIS LIB file with XC   JPRadley 20 May 92 vers 0.1
  4. Assumes System-wide preference for B+ set in GO PROFILE.
  5. Assumes Prompt character in all Fora is ^H.
  6.  
  7. Could use more checks. Providing a non-existent Forum, or one which one
  8. has not joined; providing an incorrect or inaccessible LIB number;
  9. providing a non-existent filename: all of these will cause failure
  10. while the meter's ticking.
  11. But if "all systems are go", then this should save a few pennies.
  12. README
  13.  
  14. echo "\n\tDownload a file from CompuServe using XC"
  15. echo "\n\tDefault answers are in brackets"
  16.  
  17. echo "\nWhat Forum [unixforum] ? \c"
  18. read GO
  19. FORUM=`echo ${GO:=UnixForum} | tr '[A-Z]' '[a-z]'`
  20.  
  21. echo -n "\nWhat Library [1] ? \c"
  22. read RARY
  23. LIB="LIB "${RARY:=1}
  24.  
  25. until test "$THERE"
  26. do
  27.     echo "\nName (case-insensitive) of the file on CIS? \c"
  28.     read THERE
  29. done
  30.  
  31. WHERE="[$THERE] "
  32. while :
  33. do
  34. echo -n "\nPathname (case-sensitive) to use here $WHERE? "
  35.     read AND
  36.     HERE=${AND:-$THERE}
  37.     if test -f "$HERE" || test -d "$HERE"
  38.     then
  39.         echo "\n'$HERE' already exists. You may BREAK from this"
  40.         echo "script and either remove or rename '$HERE',"
  41.         echo "or choose another name instead.\n"
  42.         WHERE=''
  43.     else
  44.         break
  45.     fi
  46. done
  47.  
  48. S=/usr/tmp/Download$$    # not publicly readable, to protect CIS password
  49. trap 'rm $S' 0 2 3
  50.  
  51. cat >$S <<sCrIpT
  52. set cis "on"
  53.  
  54. call ".cisdial"
  55.  
  56. pause 3; transmit "^C"
  57. assign SERVICE eq "$FORUM"
  58. call ".pass"
  59. tty "on"
  60.  
  61. waitfor "moment please..."
  62. if ! waitfor "forum !^H" 60; then transmit "bye^M"; quit; endif
  63.  
  64. transmit "$LIB^M"
  65. waitfor "$LIB !^H"
  66. transmit "DOW $THERE^M"
  67. transmit "$HERE^M"
  68.  
  69. waitfor "$LIB !^H"
  70. transmit "off^M"
  71.  
  72. quit
  73. sCrIpT
  74.  
  75. xc -s$S
  76.